Skip to content

Overloaded BindN, BindNReturn, and MergeSourcesN members for applicative CE's#9605

Closed
baronfel wants to merge 17 commits intodotnet:mainfrom
baronfel:CEs-with-overloads
Closed

Overloaded BindN, BindNReturn, and MergeSourcesN members for applicative CE's#9605
baronfel wants to merge 17 commits intodotnet:mainfrom
baronfel:CEs-with-overloads

Conversation

@baronfel
Copy link
Copy Markdown
Member

This PR is an experiment I've been doing with @gusty to see how the alternative, overload-based syntax for the applicative CE members might look. It's built on top of his tuple-unification PR (#9586) to allow for SRTPs to target arbitrary-length tuples.

My logic changes are entirely constrained to TypeChecker.fs, and should only be in the TcComputationExpression function, as is to be expected from changes to...typechecking CEs.

A few changes were made to the logic, but overall it seems to be working quite well in my initial tests:

  • I implemented a tuple-length check for calls to see what maximum number of Sources we could support for MergeSourcesN
  • I retained the older numeric-suffix member processing, so this new mechanism is only triggered if the numeric members do not exist on the CE

@baronfel baronfel force-pushed the CEs-with-overloads branch from 3f39365 to aa54328 Compare June 30, 2020 21:01
@gusty
Copy link
Copy Markdown
Contributor

gusty commented Jun 30, 2020

I will add some tests/sample code.

@baronfel baronfel force-pushed the CEs-with-overloads branch from 769d7cc to c089240 Compare June 30, 2020 21:33
gusty and others added 5 commits July 1, 2020 20:31
…rgeSourcesN overloads

This mechanism uses 'N'-suffixes for the members and takes tuples of varying lengths as the inputs.
This allows for the same member name to be overloaded, and allows for some SRTP-friendly use cases.
@baronfel baronfel force-pushed the CEs-with-overloads branch from de4ff50 to c04d01c Compare July 1, 2020 20:31
@brettfo brettfo changed the base branch from master to main August 19, 2020 20:01
@cartermp
Copy link
Copy Markdown
Contributor

As per #9586 (comment) I think I will close this out

@cartermp cartermp closed this Sep 17, 2020
@gusty
Copy link
Copy Markdown
Contributor

gusty commented Sep 17, 2020

#9586 is needed for the strong type samples to work, but not for the reflection based ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants